<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>window.cpp 示例文件 | Qt Widgets 5.12.3</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="../qtdoc/index.html">Qt 5.12</a></td><td ><a href="qtwidgets-index.html">Qt Widgets</a></td><td ><a href="qtwidgets-animation-easing-example.html">Easing Curves Example</a></td><td >window.cpp 示例文件</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtwidgets-index.html">Qt 5.12.3 参考指南</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">window.cpp 示例文件</h1>
<span class="subtitle">animation/easing/window.cpp</span>
<!-- $$$animation/easing/window.cpp-description -->
<div class="descr"> <a name="details"></a>
<pre class="cpp">

  <span class="comment">/****************************************************************************
  **
  ** Copyright (C) 2016 The Qt Company Ltd.
  ** Contact: https://www.qt.io/licensing/
  **
  ** This file is part of the QtCore module of the Qt Toolkit.
  **
  ** $QT_BEGIN_LICENSE:BSD$
  ** Commercial License Usage
  ** Licensees holding valid commercial Qt licenses may use this file in
  ** accordance with the commercial license agreement provided with the
  ** Software or, alternatively, in accordance with the terms contained in
  ** a written agreement between you and The Qt Company. For licensing terms
  ** and conditions see https://www.qt.io/terms-conditions. For further
  ** information use the contact form at https://www.qt.io/contact-us.
  **
  ** BSD License Usage
  ** Alternatively, you may use this file under the terms of the BSD license
  ** as follows:
  **
  ** &quot;Redistribution and use in source and binary forms, with or without
  ** modification, are permitted provided that the following conditions are
  ** met:
  **   * Redistributions of source code must retain the above copyright
  **     notice, this list of conditions and the following disclaimer.
  **   * Redistributions in binary form must reproduce the above copyright
  **     notice, this list of conditions and the following disclaimer in
  **     the documentation and/or other materials provided with the
  **     distribution.
  **   * Neither the name of The Qt Company Ltd nor the names of its
  **     contributors may be used to endorse or promote products derived
  **     from this software without specific prior written permission.
  **
  **
  ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  ** &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.&quot;
  **
  ** $QT_END_LICENSE$
  **
  ****************************************************************************/</span>

  <span class="preprocessor">#include &quot;window.h&quot;</span>

  Window<span class="operator">::</span>Window(<span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>parent)
      : <span class="type"><a href="qwidget.html">QWidget</a></span>(parent)<span class="operator">,</span>
      m_iconSize(<span class="number">64</span><span class="operator">,</span> <span class="number">64</span>)
  {
      m_ui<span class="operator">.</span>setupUi(<span class="keyword">this</span>);
      <span class="type"><a href="qbuttongroup.html">QButtonGroup</a></span> <span class="operator">*</span>buttonGroup <span class="operator">=</span> findChild<span class="operator">&lt;</span><span class="type"><a href="qbuttongroup.html">QButtonGroup</a></span> <span class="operator">*</span><span class="operator">&gt;</span>();     <span class="comment">// ### workaround for uic in 4.4</span>
      m_ui<span class="operator">.</span>easingCurvePicker<span class="operator">-</span><span class="operator">&gt;</span>setIconSize(m_iconSize);
      m_ui<span class="operator">.</span>easingCurvePicker<span class="operator">-</span><span class="operator">&gt;</span>setMinimumHeight(m_iconSize<span class="operator">.</span>height() <span class="operator">+</span> <span class="number">50</span>);
      buttonGroup<span class="operator">-</span><span class="operator">&gt;</span>setId(m_ui<span class="operator">.</span>lineRadio<span class="operator">,</span> <span class="number">0</span>);
      buttonGroup<span class="operator">-</span><span class="operator">&gt;</span>setId(m_ui<span class="operator">.</span>circleRadio<span class="operator">,</span> <span class="number">1</span>);

      <span class="type"><a href="../qtcore/qeasingcurve.html">QEasingCurve</a></span> dummy;
      m_ui<span class="operator">.</span>periodSpinBox<span class="operator">-</span><span class="operator">&gt;</span>setValue(dummy<span class="operator">.</span>period());
      m_ui<span class="operator">.</span>amplitudeSpinBox<span class="operator">-</span><span class="operator">&gt;</span>setValue(dummy<span class="operator">.</span>amplitude());
      m_ui<span class="operator">.</span>overshootSpinBox<span class="operator">-</span><span class="operator">&gt;</span>setValue(dummy<span class="operator">.</span>overshoot());

      connect(m_ui<span class="operator">.</span>easingCurvePicker<span class="operator">,</span> SIGNAL(currentRowChanged(<span class="type">int</span>))<span class="operator">,</span> <span class="keyword">this</span><span class="operator">,</span> SLOT(curveChanged(<span class="type">int</span>)));
      connect(buttonGroup<span class="operator">,</span> SIGNAL(buttonClicked(<span class="type">int</span>))<span class="operator">,</span> <span class="keyword">this</span><span class="operator">,</span> SLOT(pathChanged(<span class="type">int</span>)));
      connect(m_ui<span class="operator">.</span>periodSpinBox<span class="operator">,</span> SIGNAL(valueChanged(<span class="type">double</span>))<span class="operator">,</span> <span class="keyword">this</span><span class="operator">,</span> SLOT(periodChanged(<span class="type">double</span>)));
      connect(m_ui<span class="operator">.</span>amplitudeSpinBox<span class="operator">,</span> SIGNAL(valueChanged(<span class="type">double</span>))<span class="operator">,</span> <span class="keyword">this</span><span class="operator">,</span> SLOT(amplitudeChanged(<span class="type">double</span>)));
      connect(m_ui<span class="operator">.</span>overshootSpinBox<span class="operator">,</span> SIGNAL(valueChanged(<span class="type">double</span>))<span class="operator">,</span> <span class="keyword">this</span><span class="operator">,</span> SLOT(overshootChanged(<span class="type">double</span>)));
      createCurveIcons();

      <span class="type"><a href="../qtgui/qpixmap.html">QPixmap</a></span> pix(QLatin1String(<span class="string">&quot;:/images/qt-logo.png&quot;</span>));
      m_item <span class="operator">=</span> <span class="keyword">new</span> PixmapItem(pix);
      m_scene<span class="operator">.</span>addItem(m_item);
      m_ui<span class="operator">.</span>graphicsView<span class="operator">-</span><span class="operator">&gt;</span>setScene(<span class="operator">&amp;</span>m_scene);

      m_anim <span class="operator">=</span> <span class="keyword">new</span> Animation(m_item<span class="operator">,</span> <span class="string">&quot;pos&quot;</span>);
      m_anim<span class="operator">-</span><span class="operator">&gt;</span>setEasingCurve(<span class="type"><a href="../qtcore/qeasingcurve.html">QEasingCurve</a></span><span class="operator">::</span>OutBounce);
      m_ui<span class="operator">.</span>easingCurvePicker<span class="operator">-</span><span class="operator">&gt;</span>setCurrentRow(<span class="type">int</span>(<span class="type"><a href="../qtcore/qeasingcurve.html">QEasingCurve</a></span><span class="operator">::</span>OutBounce));

      startAnimation();
  }

  <span class="type"><a href="../qtcore/qeasingcurve.html">QEasingCurve</a></span> createEasingCurve(<span class="type"><a href="../qtcore/qeasingcurve.html">QEasingCurve</a></span><span class="operator">::</span>Type curveType)
  {
      <span class="type"><a href="../qtcore/qeasingcurve.html">QEasingCurve</a></span> curve(curveType);

      <span class="keyword">if</span> (curveType <span class="operator">=</span><span class="operator">=</span> <span class="type"><a href="../qtcore/qeasingcurve.html">QEasingCurve</a></span><span class="operator">::</span>BezierSpline) {
          curve<span class="operator">.</span>addCubicBezierSegment(<span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span>(<span class="number">0.4</span><span class="operator">,</span> <span class="number">0.1</span>)<span class="operator">,</span> <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span>(<span class="number">0.6</span><span class="operator">,</span> <span class="number">0.9</span>)<span class="operator">,</span> <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span>(<span class="number">1.0</span><span class="operator">,</span> <span class="number">1.0</span>));

      } <span class="keyword">else</span> <span class="keyword">if</span> (curveType <span class="operator">=</span><span class="operator">=</span> <span class="type"><a href="../qtcore/qeasingcurve.html">QEasingCurve</a></span><span class="operator">::</span>TCBSpline) {
          curve<span class="operator">.</span>addTCBSegment(<span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span>(<span class="number">0.0</span><span class="operator">,</span> <span class="number">0.0</span>)<span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> <span class="number">0</span>);
          curve<span class="operator">.</span>addTCBSegment(<span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span>(<span class="number">0.3</span><span class="operator">,</span> <span class="number">0.4</span>)<span class="operator">,</span> <span class="number">0.2</span><span class="operator">,</span> <span class="number">1</span><span class="operator">,</span> <span class="operator">-</span><span class="number">0.2</span>);
          curve<span class="operator">.</span>addTCBSegment(<span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span>(<span class="number">0.7</span><span class="operator">,</span> <span class="number">0.6</span>)<span class="operator">,</span> <span class="operator">-</span><span class="number">0.2</span><span class="operator">,</span> <span class="number">1</span><span class="operator">,</span> <span class="number">0.2</span>);
          curve<span class="operator">.</span>addTCBSegment(<span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span>(<span class="number">1.0</span><span class="operator">,</span> <span class="number">1.0</span>)<span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> <span class="number">0</span>);
      }

      <span class="keyword">return</span> curve;
  }

  <span class="type">void</span> Window<span class="operator">::</span>createCurveIcons()
  {
      <span class="type"><a href="../qtgui/qpixmap.html">QPixmap</a></span> pix(m_iconSize);
      <span class="type"><a href="../qtgui/qpainter.html">QPainter</a></span> painter(<span class="operator">&amp;</span>pix);
      <span class="type"><a href="../qtgui/qlineargradient.html">QLinearGradient</a></span> gradient(<span class="number">0</span><span class="operator">,</span><span class="number">0</span><span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> m_iconSize<span class="operator">.</span>height());
      gradient<span class="operator">.</span>setColorAt(<span class="number">0.0</span><span class="operator">,</span> <span class="type"><a href="../qtgui/qcolor.html">QColor</a></span>(<span class="number">240</span><span class="operator">,</span> <span class="number">240</span><span class="operator">,</span> <span class="number">240</span>));
      gradient<span class="operator">.</span>setColorAt(<span class="number">1.0</span><span class="operator">,</span> <span class="type"><a href="../qtgui/qcolor.html">QColor</a></span>(<span class="number">224</span><span class="operator">,</span> <span class="number">224</span><span class="operator">,</span> <span class="number">224</span>));
      <span class="type"><a href="../qtgui/qbrush.html">QBrush</a></span> brush(gradient);
      <span class="keyword">const</span> <span class="type"><a href="../qtcore/qmetaobject.html">QMetaObject</a></span> <span class="operator">&amp;</span>mo <span class="operator">=</span> <span class="type"><a href="../qtcore/qeasingcurve.html">QEasingCurve</a></span><span class="operator">::</span>staticMetaObject;
      <span class="type"><a href="../qtcore/qmetaenum.html">QMetaEnum</a></span> metaEnum <span class="operator">=</span> mo<span class="operator">.</span>enumerator(mo<span class="operator">.</span>indexOfEnumerator(<span class="string">&quot;Type&quot;</span>));
      <span class="comment">// Skip QEasingCurve::Custom</span>
      <span class="keyword">for</span> (<span class="type">int</span> i <span class="operator">=</span> <span class="number">0</span>; i <span class="operator">&lt;</span> <span class="type"><a href="../qtcore/qeasingcurve.html">QEasingCurve</a></span><span class="operator">::</span>NCurveTypes <span class="operator">-</span> <span class="number">1</span>; <span class="operator">+</span><span class="operator">+</span>i) {
          painter<span class="operator">.</span>fillRect(<span class="type"><a href="../qtcore/qrect.html">QRect</a></span>(<span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span>(<span class="number">0</span><span class="operator">,</span> <span class="number">0</span>)<span class="operator">,</span> m_iconSize)<span class="operator">,</span> brush);
          <span class="type"><a href="../qtcore/qeasingcurve.html">QEasingCurve</a></span> curve <span class="operator">=</span> createEasingCurve((<span class="type"><a href="../qtcore/qeasingcurve.html">QEasingCurve</a></span><span class="operator">::</span>Type) i);
          painter<span class="operator">.</span>setPen(<span class="type"><a href="../qtgui/qcolor.html">QColor</a></span>(<span class="number">0</span><span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> <span class="number">255</span><span class="operator">,</span> <span class="number">64</span>));
          <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> xAxis <span class="operator">=</span> m_iconSize<span class="operator">.</span>height()<span class="operator">/</span><span class="number">1.5</span>;
          <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> yAxis <span class="operator">=</span> m_iconSize<span class="operator">.</span>width()<span class="operator">/</span><span class="number">3</span>;
          painter<span class="operator">.</span>drawLine(<span class="number">0</span><span class="operator">,</span> xAxis<span class="operator">,</span> m_iconSize<span class="operator">.</span>width()<span class="operator">,</span>  xAxis);
          painter<span class="operator">.</span>drawLine(yAxis<span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> yAxis<span class="operator">,</span> m_iconSize<span class="operator">.</span>height());

          <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> curveScale <span class="operator">=</span> m_iconSize<span class="operator">.</span>height()<span class="operator">/</span><span class="number">2</span>;

          painter<span class="operator">.</span>setPen(<span class="type"><a href="../qtcore/qt.html">Qt</a></span><span class="operator">::</span>NoPen);

          <span class="comment">// start point</span>
          painter<span class="operator">.</span>setBrush(<span class="type"><a href="../qtcore/qt.html">Qt</a></span><span class="operator">::</span>red);
          <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> start(yAxis<span class="operator">,</span> xAxis <span class="operator">-</span> curveScale <span class="operator">*</span> curve<span class="operator">.</span>valueForProgress(<span class="number">0</span>));
          painter<span class="operator">.</span>drawRect(start<span class="operator">.</span>x() <span class="operator">-</span> <span class="number">1</span><span class="operator">,</span> start<span class="operator">.</span>y() <span class="operator">-</span> <span class="number">1</span><span class="operator">,</span> <span class="number">3</span><span class="operator">,</span> <span class="number">3</span>);

          <span class="comment">// end point</span>
          painter<span class="operator">.</span>setBrush(<span class="type"><a href="../qtcore/qt.html">Qt</a></span><span class="operator">::</span>blue);
          <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> end(yAxis <span class="operator">+</span> curveScale<span class="operator">,</span> xAxis <span class="operator">-</span> curveScale <span class="operator">*</span> curve<span class="operator">.</span>valueForProgress(<span class="number">1</span>));
          painter<span class="operator">.</span>drawRect(end<span class="operator">.</span>x() <span class="operator">-</span> <span class="number">1</span><span class="operator">,</span> end<span class="operator">.</span>y() <span class="operator">-</span> <span class="number">1</span><span class="operator">,</span> <span class="number">3</span><span class="operator">,</span> <span class="number">3</span>);

          <span class="type"><a href="../qtgui/qpainterpath.html">QPainterPath</a></span> curvePath;
          curvePath<span class="operator">.</span>moveTo(start);
          <span class="keyword">for</span> (<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> t <span class="operator">=</span> <span class="number">0</span>; t <span class="operator">&lt;</span><span class="operator">=</span> <span class="number">1.0</span>; t<span class="operator">+</span><span class="operator">=</span><span class="number">1.0</span><span class="operator">/</span>curveScale) {
              <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> to;
              to<span class="operator">.</span>setX(yAxis <span class="operator">+</span> curveScale <span class="operator">*</span> t);
              to<span class="operator">.</span>setY(xAxis <span class="operator">-</span> curveScale <span class="operator">*</span> curve<span class="operator">.</span>valueForProgress(t));
              curvePath<span class="operator">.</span>lineTo(to);
          }
          painter<span class="operator">.</span>setRenderHint(<span class="type"><a href="../qtgui/qpainter.html">QPainter</a></span><span class="operator">::</span>Antialiasing<span class="operator">,</span> <span class="keyword">true</span>);
          painter<span class="operator">.</span>strokePath(curvePath<span class="operator">,</span> <span class="type"><a href="../qtgui/qcolor.html">QColor</a></span>(<span class="number">32</span><span class="operator">,</span> <span class="number">32</span><span class="operator">,</span> <span class="number">32</span>));
          painter<span class="operator">.</span>setRenderHint(<span class="type"><a href="../qtgui/qpainter.html">QPainter</a></span><span class="operator">::</span>Antialiasing<span class="operator">,</span> <span class="keyword">false</span>);
          <span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> <span class="operator">*</span>item <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span>;
          item<span class="operator">-</span><span class="operator">&gt;</span>setIcon(<span class="type"><a href="../qtgui/qicon.html">QIcon</a></span>(pix));
          item<span class="operator">-</span><span class="operator">&gt;</span>setText(metaEnum<span class="operator">.</span>key(i));
          m_ui<span class="operator">.</span>easingCurvePicker<span class="operator">-</span><span class="operator">&gt;</span>addItem(item);
      }
  }

  <span class="type">void</span> Window<span class="operator">::</span>startAnimation()
  {
      m_anim<span class="operator">-</span><span class="operator">&gt;</span>setStartValue(<span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span>(<span class="number">0</span><span class="operator">,</span> <span class="number">0</span>));
      m_anim<span class="operator">-</span><span class="operator">&gt;</span>setEndValue(<span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span>(<span class="number">100</span><span class="operator">,</span> <span class="number">100</span>));
      m_anim<span class="operator">-</span><span class="operator">&gt;</span>setDuration(<span class="number">2000</span>);
      m_anim<span class="operator">-</span><span class="operator">&gt;</span>setLoopCount(<span class="operator">-</span><span class="number">1</span>); <span class="comment">// forever</span>
      m_anim<span class="operator">-</span><span class="operator">&gt;</span>start();
  }

  <span class="type">void</span> Window<span class="operator">::</span>curveChanged(<span class="type">int</span> row)
  {
      <span class="type"><a href="../qtcore/qeasingcurve.html">QEasingCurve</a></span><span class="operator">::</span>Type curveType <span class="operator">=</span> (<span class="type"><a href="../qtcore/qeasingcurve.html">QEasingCurve</a></span><span class="operator">::</span>Type)row;
      m_anim<span class="operator">-</span><span class="operator">&gt;</span>setEasingCurve(createEasingCurve(curveType));
      m_anim<span class="operator">-</span><span class="operator">&gt;</span>setCurrentTime(<span class="number">0</span>);

      bool isElastic <span class="operator">=</span> curveType <span class="operator">&gt;</span><span class="operator">=</span> <span class="type"><a href="../qtcore/qeasingcurve.html">QEasingCurve</a></span><span class="operator">::</span>InElastic <span class="operator">&amp;</span><span class="operator">&amp;</span> curveType <span class="operator">&lt;</span><span class="operator">=</span> <span class="type"><a href="../qtcore/qeasingcurve.html">QEasingCurve</a></span><span class="operator">::</span>OutInElastic;
      bool isBounce <span class="operator">=</span> curveType <span class="operator">&gt;</span><span class="operator">=</span> <span class="type"><a href="../qtcore/qeasingcurve.html">QEasingCurve</a></span><span class="operator">::</span>InBounce <span class="operator">&amp;</span><span class="operator">&amp;</span> curveType <span class="operator">&lt;</span><span class="operator">=</span> <span class="type"><a href="../qtcore/qeasingcurve.html">QEasingCurve</a></span><span class="operator">::</span>OutInBounce;
      m_ui<span class="operator">.</span>periodSpinBox<span class="operator">-</span><span class="operator">&gt;</span>setEnabled(isElastic);
      m_ui<span class="operator">.</span>amplitudeSpinBox<span class="operator">-</span><span class="operator">&gt;</span>setEnabled(isElastic <span class="operator">|</span><span class="operator">|</span> isBounce);
      m_ui<span class="operator">.</span>overshootSpinBox<span class="operator">-</span><span class="operator">&gt;</span>setEnabled(curveType <span class="operator">&gt;</span><span class="operator">=</span> <span class="type"><a href="../qtcore/qeasingcurve.html">QEasingCurve</a></span><span class="operator">::</span>InBack <span class="operator">&amp;</span><span class="operator">&amp;</span> curveType <span class="operator">&lt;</span><span class="operator">=</span> <span class="type"><a href="../qtcore/qeasingcurve.html">QEasingCurve</a></span><span class="operator">::</span>OutInBack);
  }

  <span class="type">void</span> Window<span class="operator">::</span>pathChanged(<span class="type">int</span> index)
  {
      m_anim<span class="operator">-</span><span class="operator">&gt;</span>setPathType((Animation<span class="operator">::</span>PathType)index);
  }

  <span class="type">void</span> Window<span class="operator">::</span>periodChanged(<span class="type">double</span> value)
  {
      <span class="type"><a href="../qtcore/qeasingcurve.html">QEasingCurve</a></span> curve <span class="operator">=</span> m_anim<span class="operator">-</span><span class="operator">&gt;</span>easingCurve();
      curve<span class="operator">.</span>setPeriod(value);
      m_anim<span class="operator">-</span><span class="operator">&gt;</span>setEasingCurve(curve);
  }

  <span class="type">void</span> Window<span class="operator">::</span>amplitudeChanged(<span class="type">double</span> value)
  {
      <span class="type"><a href="../qtcore/qeasingcurve.html">QEasingCurve</a></span> curve <span class="operator">=</span> m_anim<span class="operator">-</span><span class="operator">&gt;</span>easingCurve();
      curve<span class="operator">.</span>setAmplitude(value);
      m_anim<span class="operator">-</span><span class="operator">&gt;</span>setEasingCurve(curve);
  }

  <span class="type">void</span> Window<span class="operator">::</span>overshootChanged(<span class="type">double</span> value)
  {
      <span class="type"><a href="../qtcore/qeasingcurve.html">QEasingCurve</a></span> curve <span class="operator">=</span> m_anim<span class="operator">-</span><span class="operator">&gt;</span>easingCurve();
      curve<span class="operator">.</span>setOvershoot(value);
      m_anim<span class="operator">-</span><span class="operator">&gt;</span>setEasingCurve(curve);
  }

</pre>
</div>
<!-- @@@animation/easing/window.cpp -->
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
